//
//  MovieListTableViewCell.m
//  豆瓣2
//
//  Created by dllo on 15/12/18.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "MovieListTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MovieListTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
// 重写cell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
  self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
       
        [self creatSubView];
    }
    
    return self;
}

- (void)creatSubView{
    
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(3, 3, 400, 160)];
    imageView.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    
    [self.contentView addSubview:imageView];
    
    self.headView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 100, 140)];
    self.headView.backgroundColor = [UIColor yellowColor];
    
    [self.contentView addSubview:self.headView];
    
    
    self.nameLable = [[UILabel alloc]initWithFrame:CGRectMake(120, 50, 200, 50)];
    self.nameLable.text = @"aaa";
    
    [self.contentView addSubview:self.nameLable];
    
}
-(void)setMovie:(Movie *)movie{
    _movie=movie;
    self.nameLable.text = _movie.movieName;
    
    NSURL *url = [NSURL URLWithString:_movie.pic_url];
    [self.headView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"User_Profiles_bg.png"]];
}

@end
